<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>
<%
	String db_log_id = request.getParameter("db_log_id");
%>
<html>
	<head>
		<title>流水明细</title>
	</head>
	<script type="text/javascript">
	$(function(){
		init();
	});
		function init(){
			$("#dbManage").layout();
		
				//右侧分页数据
			$('#table').datagrid({
				title:'库存明细',
				iconCls:'icon-details',
				showFooter:true,
				rownumbers:true,
				nowrap:false,
				url:'<%=contextPath %>/springMVC/warehouse/listPageMyDBLog1',
				queryParams:{
					db_log_id:'<%=db_log_id%>'
				},
				loadMsg:'正在加载数据，请稍后......',
				fitColumns:true,
				columns:[[
					{title:'日期',field:'operation_date',width:200,align:'center'},
					{title:'产品编号',field:'code',width:100,align:'center'},
					{title:'产品名称',field:'name',width:200,align:'center'},
					{title:'规格型号',field:'format_type',width:200,align:'center'},
					{title:'摘要',field:'summary',width:300,align:'center'},
					{title:'单价',field:'cost',width:50,align:'center'},
					{title:'数量',field:'num',width:50,align:'center'},
					{title:'经办人',field:'person',width:100,align:'center'},
					{title:'类别',field:'direction',width:50,align:'center',formatter:function(value,row,index){
						if(value == '0'){
							return "入库";
						}
						if(value == '1'){
							return "出库";
						}
					}},
					{title:'业务类型',field:'business_type',hidden:'true'},
					{title:'业务id',field:'business_id',hidden:'true'},
					{title:'查看凭证',field:'detail',width:50,align:'center',formatter:function(value,rowData,rowIndex){
						if(rowData.business_type == '<%=com.beaut.project.util.StaticData.DB_INIT%>'){
							return "";
						}
						if(rowData.business_type == '<%=com.beaut.project.util.StaticData.GD_SELF_REQUEST%>'){
							return "<input type='button'  style='border:0px #ff0000 solid;width:16px;height:16px;cursor:pointer;' class='icon-details' title='明细' onclick=\"showSelfRequest('"+rowData.business_id+"')\"/>";
						}
						return "";
					}}
				]],
				pageList : [10,50,100],  
				pagination:true,
				onLoadSuccess:function(rtJson){
					if(rtJson.rtState== '1')
					{
						$.messager.alert("提示",rtJson.rtMsrg);
					}
				}
			});
			//----end
}
		function showSelfRequest(request_id){
			openDialogResize('<%=contextPath %>/springViews/gd/addOrEditSelfRequest.jsp?isShow=1&id='+request_id,1000, 800);	
		}
	</script>
	<body>
		  <div id="table"  data-options="fit:true"></div>  
	</body>
</html>
